#define _CRT_SECURE_NO_WARNINGS 1
#include "stack.h"
#include "queue.h"
#include "priority_queue.h"

void Test_Stack()
{
	wjq::stack<int> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	st.push(5);

	//const wjq::stack<int> st1 = st;
	//cout << st1.top() << " ";

	while (!st.empty())
	{
		cout << st.top() << " ";
		st.pop();
	}
	cout << endl;
}

void Test_Queue()
{
	wjq::queue<int> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);
	q.push(5);

	while (!q.empty())
	{
		cout << q.front() << " ";
		q.pop();
	}
	cout << endl;
}

void Test_priority_queue()
{
	wjq::priority_queue<int> pq1;
	pq1.push(3);
	pq1.push(2);
	pq1.push(1);
	pq1.push(7);
	pq1.push(0);

	while (!pq1.empty())
	{
		cout << pq1.top() << " ";
		pq1.pop();
	}
	cout << endl;

	int arr[] = { 7,5,4,2,9,8,0,1,3 };
	wjq::priority_queue<int> pq2(arr, arr+sizeof(arr)/sizeof(arr[0]));
	while (!pq2.empty())
	{
		cout << pq2.top() << " ";
		pq2.pop();
	}
	cout << endl;

	wjq::priority_queue<int, vector<int>, wjq::greater<int>> pq3(arr, arr + sizeof(arr) / sizeof(arr[0]));
	while (!pq3.empty())
	{
		cout << pq3.top() << " ";
		pq3.pop();
	}
	cout << endl;
}

void Test_less_greater()
{
	wjq::less<int> ls;
	wjq::greater<int> gt;
	cout << ls(1, 2) << endl;
	cout << gt(1, 2) << endl;
}

int main()
{
	//Test_Stack();
	//Test_Queue();
	Test_priority_queue();
	//Test_less_greater();
	return 0;
}